package com.example.mdc.logback.design_pattern.singleton;

/**
 * Author:      liu_pc
 * Date:        2023/8/15
 * Description: 饿汉单例
 * Version:     1.0
 */
public class EagerSingleton {

    private static final EagerSingleton instance = new EagerSingleton();

    //防止外部实例化
    private EagerSingleton(){

    }

    public static EagerSingleton getInstance(){
        return instance;
    }

    public static void main(String[] args) {
        EagerSingleton eagerSingleton = EagerSingleton.getInstance();
    }
}
